package com.lb.shopguide.adapter.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lb.shopguide.entity.order.OrderTypeBean;
import com.lb.shopguide.ui.fragment.guide.order.FragmentOrderList;
import com.lb.shopguide.ui.fragment.guide.recommend.FragmentOrderRecList;

import java.util.List;

/**
 * Created by kang on 2017/6/3.
 */

public class AdapterOrderRecType extends FragmentPagerAdapter {

    private List<OrderTypeBean> listTypes;

    public AdapterOrderRecType(FragmentManager fm, List<OrderTypeBean> list) {
        super(fm);
        this.listTypes = list;
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentOrderRecList.newInstance(listTypes.get(position));
    }

    @Override
    public int getCount() {
        return listTypes.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return listTypes.get(position).getTypeName();
    }
}
